home *** CD-ROM | disk | FTP | other *** search
- /* AWNP drawlist example
- some drawlist shapes
- sorry no comments, read the drawlist docs..*/
-
- dld=''
- count=10;
-
- call linestart(10,25)
- dld=dld||line(100,25)
- call linestart(10,50)
- dld=dld||line(100,50)
- call linestart(10,75)
- dld=dld||line(100,75)
-
- /* change the data and the script won't work */
- data='11 15 34 56 43 56 67 54 55 37 '
- parse var data datum data
- linestart(count,datum)
- count=count+10
- do while data~=''
- olddatum=datum
- parse var data datum data
- dld=dld||line(count,100-datum)
- dld=dld||rect(count-2,110-datum,count+2,100)
- top=datum+(datum-olddatum)
- bottom=datum+(olddatum-datum)
- dld=dld||candle(110-top,110-bottom,100)
- count=count+10
- end
-
- dld=dld||'000000000000000000000000'x
- call open(ca,'awnpipe:drl/xc')
- call writeln(ca,'"Drawlist shapes" defg width 300 height 200')
- call writeln(ca,'drawlist minw 110 minh 100 bd dld 'length(dld))
- call writech(ca,dld)
- call writeln(ca,'image')
- call writeln(ca,'open')
- exit
-
-
- linestart:
- oldx=arg(1)
- oldy=arg(2)
- return(0)
-
- line:
- t='0001'x||'0'x||d2c(oldx)||'0'x||d2c(oldy)'0'x||d2c(arg(1))||'0'x||d2c(arg(2))||'0'x||d2c(1)
- oldx=arg(1)
- oldy=arg(2)
- return(t)
-
- rect:
- t='0002'x||'0'x||d2c(arg(1))||'0'x||d2c(arg(2))'0'x||d2c(arg(3))||'0'x||d2c(arg(4))||'0'x||d2c(2)
- return(t)
-
- candle:
- t='0001'x||'0'x||d2c(count-5)||'0'x||d2c(arg(1))'0'x||d2c(count-5)||'0'x||d2c(arg(2))||'0'x||d2c(3)
- if arg(1)>arg(2) then dif= arg(1)-arg(2)
- else dif= arg(2)-arg(1)
- dif=dif/4
- parse var dif dif '.' .
- cen=(arg(1)+arg(2))/2
- parse var cen cen '.' .
- t=t||'0002'x||'0'x||d2c(count-7)||'0'x||d2c(cen-dif)'0'x||d2c(count-3)||'0'x||d2c(cen+dif)||'0'x||d2c(3)
- t=t||'0004'x||'0'x||d2c(count)||'0'x||d2c(25)'0'x||d2c(1)||'0'x||d2c(dif)||'0'x||d2c(3)
-
- return(t)
-
-